package com.controller.seedoctor;

import com.comm.R;
import com.service.seedoctor.VisitsListService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/seeDoctor/visitsList")
@Api(value = "就诊列表所有操作功能",tags = "就诊列表的所有操作功能API接口")
@ApiResponses({
        @ApiResponse(code=200,message="请求成功"),
        @ApiResponse(code=404,message="找不到页面"),
        @ApiResponse(code=405,message="请求方法错误"),
        @ApiResponse(code=500,message="后台服务错误")
})
public class VisitsListController {
    @Autowired
    private VisitsListService listService;


    @ApiOperation(value = "新开就诊下的查看未就诊接口",notes = "查看未就诊列表",httpMethod = "get",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "bankName",value = "患者姓名",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "startTime",value = "挂号开始日期",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "endTime",value = "挂号结束日期",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "currentPage",value = "当前页",paramType = "query",dataType = "int",required = true),
            @ApiImplicitParam(name = "pageSize",value = "每页大小",paramType = "query",dataType = "int",required = true)
    })
    @ResponseBody
    @RequestMapping(value = "/selectRegListByNameAndDateRange",method = RequestMethod.GET)
    public R selectRegListByNameAndDateRange(String bankName,String startTime,String endTime,int currentPage,int pageSize){
        R r = listService.selectRegisteredListByNameAndDateRange(startTime, endTime,bankName,currentPage,pageSize);
        return r;
    }


    @ApiOperation(value = "新开就诊下的查看已就诊接口",notes = "查看已就诊列表",httpMethod = "get",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "bankName",value = "患者姓名",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "startTime",value = "就诊开始日期",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "endTime",value = "就诊结束日期",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "currentPage",value = "当前页",paramType = "query",dataType = "int",required = true),
            @ApiImplicitParam(name = "pageSize",value = "每页大小",paramType = "query",dataType = "int",required = true)

    })
    @ResponseBody
    @RequestMapping(value = "/selectSeeDoctorListByNameAndDateRange",method = RequestMethod.GET)
    public R selectSeeDoctorListByNameAndDateRange(String bankName,String startTime,String endTime,int currentPage,int pageSize) {

        System.out.println("进来了1");
        R r = listService.selectSeeDoctorListByNameAndDateRange(startTime, endTime,bankName,currentPage,pageSize);
        return r;
    }

}
